const removeAction = (index) => {
  return {
    type: 'REMOVE_DATA',
    index
  }
}

const putDataAction = task => {
  return {
    type: 'PUT_DATA',
    task
  }
}

const setdataAcion = (data) => {
  return {
    type: 'SET_DATA',
    data
  }
}

const loaddataAction = () => {
  return (dispatch) => {
    fetch('./position.json')
      .then(response => response.json())
      .then(result => {
        dispatch(setdataAcion(result.result))
      })
  }
}


export {
  removeAction,
  putDataAction,
  setdataAcion,
  loaddataAction
}